# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=ausweisapp2
pkgver=2.1.1
pkgrel=0
pkgdesc="Official authentication app for German ID card and residence permit"
url="https://www.ausweisapp.bund.de/"
arch="all"
license="EUPL-1.2"
depends="
	acsccid
	ccid
	pcsc-cyberjack
	pcsc-lite
	"
makedepends="
	cmake
	http-parser-dev
	openssl-dev
	pcsc-lite-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtscxml-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	qt6-qtwebsockets-dev
	qt6-qtwebsockets
	samurai
	"
subpackages="$pkgname-doc"
source="https://github.com/Governikus/AusweisApp2/releases/download/$pkgver/AusweisApp-$pkgver.tar.gz
	"
options="!check" # no upstream tests in release build
builddir="$srcdir/AusweisApp-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		cmake_crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		$cmake_crossopts .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f2cc9de898c3b2e61eb9ac208a21d60708aceeeb79d73f0382bc4b68e4011178217594bd99ac24b07d0d3fbd80b46e5c3ddc6c76bb764e24dc473197f4e1d4c9  AusweisApp-2.1.1.tar.gz
"
